Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
chalk-animation
Advanced tools
Colorful animations in terminal output
Name | Preview |
---|---|
rainbow | |
pulse | |
glitch | |
radar | |
neon | |
karaoke |
$ npm i chalk-animation
const chalkAnimation = require('chalk-animation');
chalkAnimation.rainbow('Lorem ipsum dolor sit amet');
You can stop and resume an animation with stop()
and start()
.
When created, the instance of chalkAnimation starts automatically.
const rainbow = chalkAnimation.rainbow('Lorem ipsum'); // Animation starts
setTimeout(() => {
rainbow.stop(); // Animation stops
}, 1000);
setTimeout(() => {
rainbow.start(); // Animation resumes
}, 2000);
Anything printed to the console will stop the previous animation automatically
chalkAnimation.rainbow('Lorem ipsum');
setTimeout(() => {
// Stop the 'Lorem ipsum' animation, then write on a new line.
console.log('dolor sit amet');
}, 1000);
Change the animation speed using a second parameter. Should be greater than 0, default is 1.
chalkAnimation.rainbow('Lorem ipsum', 2); // Two times faster than default
Change the animated text seamlessly with replace()
let str = 'Loading...';
const rainbow = chalkAnimation.rainbow(str);
// Add a new dot every second
setInterval(() => {
rainbow.replace(str += '.');
}, 1000);
Manually render frames with render()
, or get the content of the next frame with frame()
const rainbow = chalkAnimation.rainbow('Lorem ipsum').stop(); // Don't start the animation
rainbow.render(); // Display the first frame
const frame = rainbow.frame(); // Get the second frame
console.log(frame);
# Install package globally
$ npm install --global chalk-animation
$ chalk-animation --help
Colorful animations in terminal output
Usage
$ chalk-animation <name> [options] [text...]
Options
--duration Duration of the animation in ms, defaults to Infinity
--speed Animation speed as number > 0, defaults to 1
Available animations
rainbow
pulse
glitch
radar
neon
karaoke
Example
$ chalk-animation rainbow Hello world!
MIT © Boris K
FAQs
Colorful animations in terminal output
The npm package chalk-animation receives a total of 15,249 weekly downloads. As such, chalk-animation popularity was classified as popular.
We found that chalk-animation demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.